package com.qianfeng.wuyang.himalaya.activity;

import android.content.Intent;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.qianfeng.wuyang.himalaya.R;
import com.qianfeng.wuyang.himalaya.adapter.broadcastadapter.BCRadiocharsRecyclerAdapter;
import com.qianfeng.wuyang.himalaya.bean.broadcastbean.BC_topRadiosEntity;

import java.util.ArrayList;

public class RadiochartsActivity extends AppCompatActivity implements View.OnClickListener {

    private RecyclerView recycler_RcActivity;
    ArrayList<BC_topRadiosEntity> radioChartsList;
    private ImageView back;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_radiocharts);
        initView();
        Intent intent = getIntent();
        radioChartsList  = intent.getParcelableArrayListExtra("list");
        initRecycler();

    }

    private void initView() {
        //电台排行榜的recycler
        recycler_RcActivity = ((RecyclerView) findViewById(R.id.recycler_RcActivity));
        back = ((ImageView) findViewById(R.id.image_back));
        back.setOnClickListener(this);

    }
    private void initRecycler() {
        BCRadiocharsRecyclerAdapter radiocharsRecyclerAdapter = new BCRadiocharsRecyclerAdapter(this);
        radiocharsRecyclerAdapter.addAll(radioChartsList);
        recycler_RcActivity.setAdapter(radiocharsRecyclerAdapter);
    }

    @Override
    public void onClick(View view) {
        finish();
    }
}
